var prefix = api + "/gen/dsconf";

$(function() {
	var options = {
		url : prefix + "/page",
		createUrl: "/pages/tool/gen/dataSource/dataSourceEdit",
        updateUrl: "/pages/tool/gen/dataSource/dataSourceEdit",
        removeUrl: prefix + "/{id}",
		modalName : "数据源",
		columns : [
				{
		            title: "序号",
		            formatter: function (value, row, index) {
		         	    return $.table.serialNumber(index);
		            }
		        },
				{
					field : 'name',
					align: 'center',
					title : '名称',
				},
				{
					field : 'url',
					align: 'center',
					title : 'jdbcUrl',
				},
				{
					field : 'username',
                    align: 'center',
					title : '用户名',
				},
				{
					field : 'password',
					align: 'center',
					title : '密码'
				},
				{
					field : 'createDate',
                    align: 'center',
					title : '创建时间',
				},
				{
					field : 'updateDate',
					align: 'center',
					title : '更新时间'
				},
				{
					title : '操作',
					align : 'center',
					width: 150,
					formatter: function(value, row, index) {
						var actions = [];
		                actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
						actions.push('<a class="btn btn-danger btn-xs " href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
				} ]
	};
	$.table.init(options);
});